////////////////////////////////////////////////////////////////////////////////////////////////////
/// @file   CollabRCBotUnitTests\TestOperations.h
///
/// @brief  Tests the various CollabRC::Bot::AI::OperationTreeNode implementations
////////////////////////////////////////////////////////////////////////////////////////////////////

#include <cxxtest/TestSuite.h>
#include "../CollabRCBot/OperationTreeNodeImpl.h"
#include "../CollabRCBot/ComputationalTreeNode.h"
#include "../CollabRCBot/exceptions.h"

#include "MockConstantTreeNode.h"


class TestAdditionTreeNode : public CxxTest::TestSuite
{
private:
    MockConstantTreeNode m_3, m_4;
public:
    TestAdditionTreeNode():m_3(3),m_4(4) { };

    void TestOperation()
    {
        CollabRC::Bot::AI::AdditionTreeNode node(m_3, m_4);
        TS_ASSERT_EQUALS(node.PerformOperation(10, 20), 30);
        TS_ASSERT_EQUALS(node.PerformOperation(-10, -20), -30)
    }

    void TestClone()
    {
        CollabRC::Bot::AI::AdditionTreeNode node(m_3, m_4);
        CollabRC::Bot::AI::AdditionTreeNode* clone = dynamic_cast<CollabRC::Bot::AI::AdditionTreeNode*>(node.Clone());
        TS_ASSERT(clone != NULL);
        TS_ASSERT_EQUALS(clone->Compute(), node.Compute());
    }
};